package yl.hs.bmipfull.service.salemanage;

import com.fasterxml.jackson.core.JsonProcessingException;
import yl.hs.bmipfull.pojo.salemanage.SaleOrderEntity;
import yl.hs.bmipfull.service.IBaseService;
import yl.hs.bmipfull.viewmodels.PageQuery;
import yl.hs.bmipfull.viewmodels.PageResult;

import java.util.List;
import java.util.Map;

/**
 * ISaleOrderService
 *
 * @author 谢景广
 * @category
 * @date 2021-06-02
 */
public interface ISaleOrderService extends IBaseService {
    /**
     * 根据分页查询参数查询分页信息
     *
     * @param query 分页查询参数
     * @return
     */
    PageResult<Object> queryPage(PageQuery query, int rowNum, int page);
    List<Object> queryList(PageQuery query);
    SaleOrderEntity findBySn(String sn);

    Integer saveSaleTask(Map<String, Object> data, String sn) throws Exception;

    Integer delete(String[] sn);

    /**
     * 根据销售订单的编号删除销售订单的信息
     *
     * @param sn
     * @param state
     * @return
     */
    Integer changeToState(String[] sn, short state);

    /**
     * 根据销售订单的编号删除销售订单的信息
     *
     * @param sn
     * @param state
     * @return
     */
    Integer cancelOrder(String sn, short state) throws JsonProcessingException;

    /**
     * 获取工地用户相关的销售订单信息
     * @param query 查询条件
     * @param rowNum 每页显示数量
     * @param page 当前页码
     * @return 销售订单分页信息
     */
    PageResult<Object> queryContractOrders(PageQuery query, int rowNum, int page) throws Exception;
}
